home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-01-01 | 12.8 KB | 1,213 lines |
- open =$ffc0
- readst =$ffb7
- setlfs =$ffba
- setnam =$ffbd
- setmsg =$ff90
- load =$ffd5
- getin =$ffe4
- input'buffer =512
- clrchn =$ffcc
- close =$ffc3 ;a
- chrin =$ffcf
- chkout =$ffc9 ;x
- chkin =$ffc6 ;x
- plot =$fff0
- chrout =$ffd2
- color'pointer =243
- screen'line'pointer =209
- print'number =$bdcd ;x,a
- clear'line =59903
- background =53281
- border =53280
- strout = $ab1e; .A low .Y high
- unlisten =$ffae
- clall =$ffe7
- white =5
- crsr'down =17
- rvs'on =18
- home =19
- del =20
- red =28
- crsr'right =29
- green =30
- blue =31
- black =144
- lowercase =14
- uppercase =142
- crsr'up =145
- rvs'off =146
- clr =147
- insert =148
- brown =149
- light'red =150
- dark'grey =151
- medium'grey =152
- light'green =153
- light'blue =154
- light'grey =155
- purple =156
- crsr'left =157
- yellow =158
- cyan =159
- top'left =176
- top'right =174
- bottom'left =173
- bottom'right =189
- buffer =$200
-
- mouse =49152
- ml =mouse
- v =ml+111
- minx =v+21
- maxx =v+22
- miny =v+23
- maxy =v+24
- code =v+25
- color =v+26
- color2 =v+27
-
- cellx =v+31
- celly =v+32
- left'button =v+33
- new'left'push =v+34
- right'button =v+35
- new'right'push =v+36
- region'under'mouse =v+37
- clicked'region =v+38
- feedback =v
-
- .org $9000
- .obj "@0:tail ii 9000"
- ;mem
- jmp menu'entry
- jmp multi'menu'entry;3
- jmp wizard'box;6
- jmp brancher;9
- jmp center;12
- jmp wrap;15
- jmp bload;18
- jmp print'file;21
- jmp index'file;24
- jmp ml'menu'entry;27
- jmp ml'multi'menu'entry;30
- jmp ml'brancher;33
- jmp ml'wrap ;36
- jmp ml'print'file;39
- jmp ml'index'file;42
- jmp ml'center;45
- jmp clear'buffer;48
- jmp change'cycle;51
- jmp ml'change'color;54
- jmp init'wrap ;57
- jmp init'page ;60
- jmp ml'init'wrap ;63
- jmp ml'init'page ;66
- jmp wrap'device ;69
- jmp ml'wrap'device;72
- jmp linx;75
- jmp replace;78
- jmp ml'replace;81
- ;mp wrap'til'zero
- ;mp ml'wrap'til'zero
- ;mp wrap'til'line
- ;mp ml'wrap'til'line
-
- wizard'box jsr get'number
- sty minx
- jsr get'number
- sty minx+1
- jsr get'number
- sty minx+2
- jsr get'number
- sty minx+3
- jsr get'number
- sty minx+4
- jsr get'number
- sty minx+5
- ldx miny
- ldy #0
- clc
- jsr plot
- jsr old'rom'patch
-
- ldy #39
- - lda (209),y
- sta buffer,y
- lda (243),y
- sta buffer+40,y
- dey
- bpl -
-
- jsr ml+84
-
- ldy #6
- - lda minx,y
- sta wizard'dimensions,y
- dey
- bpl -
-
- jsr setup'frame
- jsr get'number
- sty wizard'dimensions+7
- tya
- clc
- adc #16
- sta color
- lda #0
- sta code
- jsr ml+84
- lda wizard'dimensions+7
- sta minx+5
- lda #0
- sta code
- ldy minx
- iny
- sty minx
- ldy maxx
- dey
- sty maxx
- ldy miny
- iny
- sty miny
- sty maxy
- jsr ml+84
- ldy minx
- ldx miny
- clc
- jsr plot
- lda wizard'dimensions+5
- sta 646
- lda #1
- sta 199
-
- jsr get'string
- sta 251
- ldy #0
- - lda ($22),y
- jsr chrout
- iny
- cpy 251
- bne -
-
- inc 211
- ldx wizard'dimensions+2
- ldy 211
- sty temp
- clc
- jsr plot
- jsr old'rom'patch
-
- ldy temp
- - lda buffer,y
- sta (209),y
- lda buffer+40,y
- sta (243),y
- iny
- cpy #40
- bcc -
-
- ldy temp
- dey
- lda #110
- sta (209),y
- lda wizard'dimensions+7
- sta 646
- sta (243),y
-
- lda #crsr'down
- jsr chrout
- jsr old'rom'patch
- ldy temp
- dey
- lda #109
- sta (209),y
- lda 646
- sta (243),y
-
- iny
- - lda #64
- sta (209),y
- lda 646
- sta (243),y
- iny
- cpy wizard'dimensions+1
- bcc -
-
- ldy wizard'dimensions+1
- lda #110
- sta (209),y
- lda 646
- sta (243),y
-
- ldy wizard'dimensions
- iny
- iny
- sty left'limit
- sty 211
- ldy #0
- sty word'index
- sty line'pos
- ldy wizard'dimensions+1
- dey
- dey
- sty right'limit
- lda wizard'dimensions+2
- clc
- adc #3
- sta 214
- jsr 58732
- jsr car'return
- lda wizard'dimensions+5
- sta 646
- lda wizard'dimensions+4
- and #128
- sta 199
- jsr clear'buffer
- jmp linx
-
-
- setup'frame lda #64
- sta v+11
- sta v+12
- lda #93
- sta v+13
- sta v+14
- lda #112
- sta v+15
- lda #110
- sta v+16
- lda #109
- sta v+17
- lda #125
- sta v+18
- lda #0
- sta v+10
-
- rts
-
- get'string jsr $aefd
- jsr $ad9e
- jsr $b6a3
-
- ldx $22
- ldy $23
- rts
-
- old'rom'patch lda 210
- sec
- sbc 648
- clc
- adc #$d8
- sta 244
- lda 209
- sta 243
- rts
-
- get'number jsr $aefd
- jsr $ad8a
- jmp $b7f7
-
- word'wrap sty temp
- ;ldy #0
- lda ($22),y
- ldy word'index
-
- cmp "_"
- bne +
-
- lda #13
-
- + cmp #13
- bne +
- jsr print'word
- jsr car'return
- rts
-
- + inc word'index
- sta buffer,y
-
- cmp " "
- bne +
- jsr print'word
- rts
-
- + lda line'pos
- clc
- adc word'index
- cmp right'limit
- bcc +
- jsr car'return
- lda line'pos
- clc
- adc word'index
- cmp right'limit
- bcc +
- jsr print'word
- jsr car'return
-
- + rts
-
- car'return lda #13
- jsr chrout
- lda wdevice
- cmp #3
- beq +
- ldy #0
- lda " "
- - jsr chrout
- iny
- cpy left'limit
- bcc -
- bcs ++
- + lda left'limit
- sta 211
- jsr 58732
- + lda left'limit
- sta line'pos
- lda reverse'flag
- sta 199
- inc line'number
- ldx line'number
- sta $14
- rts
-
- print'word lda word'index
- bne +
- rts
- + ldy #0
- - lda buffer,y
- jsr chrout
- iny
- inc line'pos
- cpy word'index
- bne -
- lda #0
- sta word'index
- jsr clear'buffer
- rts
-
- rom'out pha
- sei
- lda #$74
- sta 1
- pla
- rts
-
- rom'in pha
- lda #$77
- sta 1
- cli
- pla
- rts
-
- ml'init'page lda #0
- sta line'number
-
- ml'init'wrap stx left'limit
- sty right'limit
- lda #0
- sta word'index
- sta line'pos
- rts
-
- init'page lda #0
- sta line'number
-
- init'wrap jsr get'number
- sty left'limit
- jsr get'number
- sty right'limit
- lda #0
- sta word'index
- sta line'pos
- rts
-
- wrap jsr get'string
- ml'wrap sta temp+1
- cmp #0
- bne +
-
- rts
-
- + lda 199
- sta reverse'flag
- ldy #0
- - lda ($22),y
- jsr word'wrap
- ldy temp
- iny
- cpy temp+1
- bcc -
- rts
-
-
- change'cycle jsr get'number
- sty colors
- jsr get'number
- sty colors+1
- jsr get'number
- sty colors+2
- jsr get'number
- sty colors+3
- rts
-
- ml'change'color stx 251
- sty 252
- jsr get'parameter
- sty colors
- jsr get'parameter
- sty colors+1
- jsr get'parameter
- sty colors+2
- jsr get'parameter
- sty colors+3
- rts
-
-
-
-
- multi'menu'entry ldy #0
- sty flag
- sty menu'side
- iny
- sty menu'type
- jsr get'number
- sty menuy
- jsr get'number
- sty menux1
- jsr get'number
- sty menux2
- jsr get'number
- sty menux3
- jsr get'number
- sty menux4
- jsr get'number
- sty menu'rows
- jsr get'number
- sty menu'text
- jsr get'number
- sty menu'highlight
- jsr get'number
- sty exit'key
-
- jmp find'bottom
-
- ;sys,addr y,x1,x2,number items,text,highlight,esc
-
- menu'entry lda #0
- sta temp
- sta flag
- sta menu'type
- sta menu'side
- - jsr get'number
- ldy temp
- lda $14
- sta menuy,y
- inc temp
- cpy #6
- bne -
-
- find'bottom lda 53287
- sta mouse'color
- lda menu'items
- clc
- adc menuy
- sta menu'bottom
-
- menu jsr linx
- ldx menuy
- ldy #0
- sty menu'current
- clc
- jsr plot
- jsr old'rom'patch
- lda menu'highlight
- sta mcolor
- jsr paint'line
-
- menu'wait lda #0
- sta key
- lda 197
- cmp #7
- bne +
- jmp regular
- + cmp #2
- bne +
- jmp regular
- + jsr ml+66
- fix'color inc cycle
- ldy cycle
- cpy #4
- bcc cycle'okay
- ldy #0
- sty cycle
- cycle'okay lda colors,y
- sta 53287
- lda feedback+32
- cmp menuy
- bcc regular
- cmp menu'bottom
- bcs regular
- lda feedback+31
- cmp menux1
- bcc regular
- lda menux2
- cmp feedback+31
- bcc isitright
-
- + lda #0
- sta menu'side
- lda feedback+34;check click
- beq +
- jsr adjust'highlight
- jmp menu'select
-
- + lda menu'side
- cmp last'side
- bne ++
-
- + lda feedback+32
- cmp last
- beq isitright
- + jsr adjust'highlight
- jmp highlight
-
- isitright lda menu'type
- beq regular
- lda feedback+31
- cmp menux3
- bcc regular
- lda menux4
- cmp feedback+31
- bcc regular
-
- + lda #1
- sta menu'side
- lda feedback+34;check click
- beq +
- jsr adjust'highlight
- jmp menu'select
-
- + lda menu'side
- cmp last'side
- bne ++
-
- + lda feedback+32
- cmp last
- beq regular
- + jsr adjust'highlight
- jmp highlight
-
- - jmp menu'wait
- regular lda feedback+34
- beq +
- lda exit'key
- sta 631
- lda #1
- sta 198
- dec flag
- + jsr getin
- beq -
-
- ldx menu'current
- stx temp
-
- cmp #crsr'down
- beq menu'down
-
- cmp #crsr'up
- beq menu'up
-
- cmp #crsr'left
- beq menu'switch
-
- cmp #crsr'right
- beq menu'switch
-
- cmp #13
- beq menu'select
-
- cmp exit'key
- bne menu'wait'loop
- lda #255
- sta menu'current
- dec flag
- bmi menu'select
-
- menu'wait'loop jmp menu'wait
-
- menu'down inc key
- inc menu'current
- lda menu'current
- cmp menu'items
- beq +
- jmp highlight
- + lda #0
- sta menu'current
- lda menu'type
- beq highlight
- lda #1
- sec
- sbc menu'side
- sta menu'side
- jmp highlight
-
- menu'up inc key
- dec menu'current
- lda menu'current
- cmp #255
- beq +
- jmp highlight
-
- + ldy menu'items
- dey
- sty menu'current
- menu'switch inc key
- lda menu'type
- beq highlight
- lda #1
- sec
- sbc menu'side
- sta menu'side
- jmp highlight
-
- menu'select lda mouse'color
- sta 53287
- lda menu'current
- clc
- adc menuy
- tax
- ldy #0
- jsr plot
- jsr old'rom'patch
- lda menu'text
- sta mcolor
- jsr paint'line
-
- bit flag
- beq +
- ldy #0
- sty menu'side
- beq ++
- + ldy menu'current
- iny
- + sty 251
- lda menu'side
- beq +
- lda menu'items
- clc
- adc 251
- sta 251
-
- + ldx 251
- ldy #0
- lda "i"
- jmp make'variable
-
- highlight lda menuy
- clc
- adc temp
- tax
- ldy #0
- clc
- jsr plot
- jsr old'rom'patch
- lda menu'text
- sta mcolor
- lda menu'side
- pha
- lda last'side
- sta menu'side
- jsr paint'line
- pla
- sta menu'side
-
- lda menuy
- clc
- adc menu'current
- tax
- ldy #0
- clc
- jsr plot
- jsr old'rom'patch
- lda menu'highlight
- sta mcolor
- jsr paint'line
-
- jmp menu'wait
-
- paint'line lda menu'side
- bne paint'other'side
- ldy menux1
- - lda mcolor
- sta (243),y
- bmi +
- lda (209),y
- eor #128
- sta (209),y
- + iny
- cpy menux2
- beq -
- bcc -
- lda #0
- sta last'side
- lda key
- beq +
- ldx menux2
- ldy 214
- jsr mouse+78
- + rts
-
- paint'other'side ldy menux3
- - lda mcolor
- sta (243),y
- bmi +
- lda (209),y
- eor #128
- sta (209),y
- + iny
- cpy menux4
- beq -
- bcc -
- lda #1
- sta last'side
- lda key
- beq +
- ldx menux3
- ldy 214
- jsr mouse+78
- + rts
-
-
- print'string ldy #0
- - lda ($22),y
- jsr chrout
- iny
- cpy temp
- bne -
- rts
-
- ml'center sta temp;store string location in $22
- tya;store line number in y
- tax;store string length in a
- ldy #0
- clc
- jsr plot
- lda temp
- jmp +
-
- center jsr get'number
- tya
- tax
- ldy #0
- clc
- jsr plot
-
- jsr get'string
- sta temp
-
- + lsr
- sta flag
- lda #20
- sec
- sbc flag
- sta 211
- jsr 58732
- jmp print'string
-
- ;poll'mouse jsr ml+66
- ;ldy #40
- ;getvars lda v,y
- ;sta feedback,y
- ;dey
- ;bpl getvars
- ;rts
-
- adjust'highlight lda menu'current
- sta temp
- lda feedback+32
- sta last
- sec
- sbc menuy
- sta menu'current
- rts
-
- brancher lda #0
- sta 251
- jsr get'string
- mlb sta 252
- jsr getin
-
- ldy #0
- - cmp ($22),y
- bne +
- iny
- tya
- tax
- outwego ldy #0
- lda "i"
- jmp make'variable
-
- + iny
- cpy 252
- bne -
- ldx #0
- jmp outwego
-
- linx ldy #24
- - lda 217,y
- ora #128
- sta 217,y
- dey
- bpl -
- rts
-
- find'file jsr get'number
- sta 252
- sty 251
- jsr get'number
- sty 253
- sta 254
- ml'find ldy #4
- - asl 253
- rol 254
- dey
- bpl -
-
- lda 253
- clc
- adc 251
- sta $14
- lda 254
- adc 252
- sta $15
-
- ldy #3
- - jsr rom'out
- lda ($14),y
- jsr rom'in
- iny
- cmp #34
- beq +
- bne -
-
- + rts
-
- print'file jsr linx
- jsr get'number
- sty 211
- jsr get'number
- sty 214
- jsr 58732
- jsr find'file
- mlp =*
- - jsr rom'out
- lda ($14),y
- jsr rom'in
- cmp #34
- beq +
- jsr chrout
- iny
- bne -
- + rts
-
- index'file jsr find'file
- ldx #0
- - jsr rom'out
- lda ($14),y
- jsr rom'in
- cmp #34
- beq +
- sta buffer,x
- inx
- iny
- bne -
- + stx wlength
- bit output
- bmi +
- jmp make'wstring
- + ldx <buffer
- ldy >buffer
- lda wlength
- rts
-
- bload jsr get'string
- jsr setnam
- jsr get'number
- tya
- tax
- lda #1
- ldy #0
- jsr setlfs
- jsr get'number
- sty dir
- sta dir+1
- ldx $14
- ldy $15
- lda #0
- jsr load
- lda 174
- sec
- sbc dir
- sta 251
- lda 175
- sbc dir+1
- sta 252
- ldy #4
- - lsr 252
- ror 251
- dey
- bpl -
- lda 251
- sec
- sbc #1
- sta 251
- lda 252
- sbc #0
- sta 252
- ldx 251
- ldy 252
- lda "n"
- jmp make'variable
-
- make'variable bit output
- bpl +
- inc output
- rts
- + stx 201
- sty 202
- sta 251;accumulator should hold var name
- lda "%"
- sta 252
- lda #0
- sta 253
- lda $7a
- pha
- lda $7b
- pha
-
- lda <251
- sta $7a
- lda >251
- sta $7b
- jsr $b08b
- ldy #0
- lda 202 ;high byte
- sta ($47),y
- iny
- lda 201;low byte
- sta ($47),y
- pla
- sta $7b
- pla
- sta $7a
- rts
-
- locvar lda $7a
- pha
- lda $7b
- pha
- stx $7a
- sty $7b
- jsr $b08b
- sta $49
- sty $4a
- pla
- sta $7b
- pla
- sta $7a
- rts
-
- set'string sta $64
- sty $65
- jmp $aa52
-
- make'wstring bit output
- bpl +
- inc output
- lda wlength
- rts
- + ldx <string'name
- ldy >string'name
- jsr locvar
- lda <wlength
- ldy >wlength
- jsr set'string
-
- clear'buffer ldy #79
- lda #0
- sta 212
- - sta buffer,y
- dey
- bpl -
- rts
-
- ml'menu'entry stx 251
- sty 252
- lda #255
- sta output
- ldy #6
- jsr rom'out
- - lda (251),y
- sta menuy,y
- dey
- bpl -
- jsr rom'in
- lda #0
- sta flag
- sta menu'type
- sta menu'side
- jmp find'bottom
-
- ml'multi'menu'entry stx 251
- sty 252
- ldy #0
- sty flag
- sty menu'side
- iny
- sty menu'type
- lda #255
- sta output
- jsr get'parameter
- sty menuy
- jsr get'parameter
- sty menux1
- jsr get'parameter
- sty menux2
- jsr get'parameter
- sty menux3
- jsr get'parameter
- sty menux4
- jsr get'parameter
- sty menu'rows
- jsr get'parameter
- sty menu'text
- jsr get'parameter
- sty menu'highlight
- jsr get'parameter
- sty exit'key
-
- jmp find'bottom
-
- get'parameter ldy #0
- lda (251),y
- inc 251
- bne +
- inc 252
- + tay
- rts
-
- ml'brancher stx $22
- sty $23
- dec output
- jmp mlb
-
- ml'print'file jsr ml'find
- jmp mlp
-
- ml'index'file lda #255
- sta output
- jsr ml'find
- jmp index'file+3
-
- wrap'device jsr get'number
- ml'wrap'device sty wdevice
- rts
-
- ml'replace stx temp
- sty temp+1
- sta temp
- jmp +
- replace jsr get'number
- sty temp
- jsr get'number
- sty temp+1
- jsr get'string
- sta temp+2
- + ldy #0
- - lda ($22),y
- cmp temp
- bne +
- lda temp+1
- sta ($22),y
- + iny
- cpy temp
- bcc -
- rts
-
- ;jmp wrap'til'zero jsr get'number
- ;sty $22
- ;sta $23
- ;ml'wrap'til'zero ldy #0
- ;lda ($22),y
-
-
-
-
- ;jmp wrap'til'line
- ;jmp ml'wrap'til'line
-
-
- wdevice .byt 3
- string'name .asc "f$":.byt 0
- wlength .byt 0
- .word buffer
-
- last .byt 0
-
- ;mouse'loc .word ml
- ;v'loc .word ml+111
- ;minx'loc .word ml+132
-
- menuy .byt 0
- menux1 .byt 0
- menux2 .byt 0
- menu'items .byt 0
- menu'rows =menu'items
- menu'text .byt 0
- menu'highlight .byt 0
- exit'key .byt 0
- menu'bottom .byt 0
- menu'current .byt 0
- mcolor .byt 0
- menux3 .byt 0
- menux4 .byt 0
- menu'side .byt 0
- last'side .byt 0
- menu'type .byt 0
- left .byt 0
- right .byt 0
- x1 .byt 0
- x2 .byt 1
- y1 .byt 2
- y2 .byt 3
- screen'code .byt 4
- box'color .byt 5
- flag .byt 6
- key .byt 0
- colors .byt 1,1,1,1
- cycle .byt 0
- mouse'color .byt 0
-
- output .byt 0
- dir .word 0
- files .word 0
-
- right'limit .byt 37
- left'limit .byt 1
- reverse'flag .byt 0
- last'char .byt 0
- word'index .byt 0
- line'pos .byt 0
- line'number .byt 0
-
- temp .buf 5
- device .byt 0
- wizard'dimensions .buf 10
-
-
-
-
-
-
-